package com.len.controller;

import com.len.base.BaseController;
import com.len.entity.SpYongjin;
import com.len.service.SpYongjinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("yongjin")
public class SpYongjinController extends BaseController<SpYongjin> {
    @Autowired
    private SpYongjinService spYongjinService;
    @RequestMapping("/show")
    public String show(SpYongjin spYongjin){
        try {
            spYongjinService.selectByPrimaryKey(spYongjin);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
    @RequestMapping("/list")
    @ResponseBody
    public List<Map> list(SpYongjin spYongjin){
        return spYongjinService.listPh();
    }
    @RequestMapping("/save")
    public String save(SpYongjin spYongjin){
        try {
            spYongjinService.insert(spYongjin);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
    @RequestMapping("/update")
    public String update(SpYongjin spYongjin){
        try {
            spYongjinService.updateByPrimaryKey(spYongjin);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
